import requests from "./requests";

//通过关键词搜索书籍按时间排序
export const searchNewBookByKeyWords = (keyWord) => {
  return requests({
    method: "GET",
    url: `/api/searchBookByKeyWordOrderTime?keyWord=${keyWord}`,
  });
};
//通过关键词搜索书籍按热度排序
export const searchHotBookByKeyWords = (keyWord) => {
  return requests({
    method: "GET",
    url: `/api/searchBookByKeyWordOrderView?keyWord=${keyWord}`,
  });
};
//价格降序
export const searchPriceAsceBookByKeyWords = (keyWord) => {
  return requests({
    method: "GET",
    url: `/api/searchBookByKeyWordOrderPriceAesc?keyWord=${keyWord}`,
  });
};
// 价格升序
export const searchPriceDescBookByKeyWords = (keyWord) => {
  return requests({
    method: "GET",
    url: `/api/searchBookByKeyWordOrderPriceDesc?keyWord=${keyWord}`,
  });
};

export const searchUser=(keyWord)=>{
  return requests({
    method:'GET',
    url:`/api/searchUserByKeyWord?keyWord=${keyWord}`
  })
}
export const followUser=(focusId)=>{
  return requests({
    method:'POST',
    url:`/api/followUser`,
    data:{
      focusId
    }
  })
}
export const unFollowUser=(focusId)=>{
  return requests({
    method:'POST',
    url:`/api/unFollowUser`,
    data:{
      focusId
    }
  })
}
